package io.homework;

import java.io.File;
import java.io.FileInputStream;
import java.nio.charset.StandardCharsets;

public class Test6 {
    public static void main(String[] args) throws Exception {
        File file = new File("test1.txt");
        FileInputStream fis = new FileInputStream(file);

        byte[] data = new byte[(int)file.length()];

        fis.read(data);
        String s = new String(data, StandardCharsets.UTF_8);
        System.out.println(s);
        System.out.println("读取完成");
        fis.close();


    }
}
